<template>
  <div class="contact-page">
    <div class="page-container">
      <!-- 页面头部 -->
      <div class="page-header animate__animated animate__fadeInUp">
        <h1 class="page-title">
          <span class="gradient-text">联系我们</span>
        </h1>
        <p class="page-subtitle">随时为您提供专业的服务支持</p>
      </div>

      <!-- 联系方式卡片 -->
      <div class="contact-grid">
        <!-- QQ群联系 -->
        <div class="contact-card tiktok-card animate__animated animate__fadeInUp">
          <div class="contact-icon">💬</div>
          <h3 class="contact-title">Cursor交流群</h3>
          <p class="contact-desc">加入我们的官方QQ群，获取最新资讯和技术支持</p>
          <div class="contact-info">
            <div class="info-item">
              <span class="info-label">群号：</span>
              <span class="info-value gradient-text">1013099557</span>
            </div>
          </div>
          <n-button type="primary" class="tiktok-btn contact-btn" @click="copyGroupNumber">
            复制群号
          </n-button>
        </div>

        <!-- 在线购买 -->
        <div class="contact-card tiktok-card animate__animated animate__fadeInUp" style="animation-delay: 0.1s">
          <div class="contact-icon">🛒</div>
          <h3 class="contact-title">在线购买</h3>
          <p class="contact-desc">访问我们的在线商城，选择适合您的套餐</p>
          <div class="contact-info">
            <div class="info-item">
              <span class="info-label">商城链接</span>
            </div>
          </div>
          <n-button type="primary" class="tiktok-btn contact-btn" @click="goToShop">
            前往商城
          </n-button>
        </div>

        <!-- 客服支持 -->
        <div class="contact-card tiktok-card animate__animated animate__fadeInUp" style="animation-delay: 0.2s">
          <div class="contact-icon">🎯</div>
          <h3 class="contact-title">客服支持</h3>
          <p class="contact-desc">7x24小时在线客服，随时为您解答疑问</p>
          <div class="contact-info">
            <div class="info-item">
              <span class="info-label">工作时间：</span>
              <span class="info-value">全天候</span>
            </div>
          </div>
          <n-button type="primary" class="tiktok-btn contact-btn" @click="goToShop">
            联系客服
          </n-button>
        </div>
      </div>

      <!-- QQ群二维码展示 -->
      <div class="qr-section animate__animated animate__fadeInUp" style="animation-delay: 0.3s">
        <h2 class="section-title">
          <span class="gradient-text">扫码加入交流群</span>
        </h2>
        <div class="qr-container">
          <div class="qr-code-large">
            <img src="@/assets/qqcode.jpg" alt="QQ群二维码" class="qr-image" />
            <p class="qr-desc">扫描二维码加入Cursor交流群</p>
          </div>
          <div class="qr-benefits">
            <h3 class="benefits-title">加群福利</h3>
            <ul class="benefits-list">
              <li class="benefit-item">
                <span class="benefit-icon">✨</span>
                <span>第一时间获取Cursor最新资讯</span>
              </li>
              <li class="benefit-item">
                <span class="benefit-icon">🎁</span>
                <span>专属优惠活动和限时折扣</span>
              </li>
              <li class="benefit-item">
                <span class="benefit-icon">👥</span>
                <span>与开发者交流使用经验</span>
              </li>
              <li class="benefit-item">
                <span class="benefit-icon">🔧</span>
                <span>专业技术支持和问题解答</span>
              </li>
              <li class="benefit-item">
                <span class="benefit-icon">📚</span>
                <span>独家教程和使用技巧分享</span>
              </li>
            </ul>
          </div>
        </div>
      </div>

      <!-- 购买流程 -->
      <div class="process-section animate__animated animate__fadeInUp" style="animation-delay: 0.4s">
        <h2 class="section-title">
          <span class="gradient-text">购买流程</span>
        </h2>
        <div class="process-steps">
          <div class="process-step">
            <div class="step-number">1</div>
            <div class="step-content">
              <h4>选择套餐</h4>
              <p>根据需求选择合适的Cursor套餐</p>
            </div>
          </div>
          <div class="step-arrow">→</div>
          <div class="process-step">
            <div class="step-number">2</div>
            <div class="step-content">
              <h4>访问商城</h4>
              <p>点击前往商城完成购买</p>
            </div>
          </div>
          <div class="step-arrow">→</div>
          <div class="process-step">
            <div class="step-number">3</div>
            <div class="step-content">
              <h4>获取激活码</h4>
              <p>支付成功后自动发送激活码</p>
            </div>
          </div>
          <div class="step-arrow">→</div>
          <div class="process-step">
            <div class="step-number">4</div>
            <div class="step-content">
              <h4>开始使用</h4>
              <p>激活Cursor开启AI编程之旅</p>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
import { useMessage } from 'naive-ui'

const message = useMessage()

const copyGroupNumber = async () => {
  try {
    await navigator.clipboard.writeText('1013099557')
    message.success('群号已复制到剪贴板')
  } catch (error) {
    message.error('复制失败，群号：1013099557')
  }
}

const goToShop = () => {
  window.open('https://pay.ldxp.cn/shop/rpmn', '_blank')
}
</script>

<style scoped>
.contact-page {
  min-height: 100vh;
  padding-top: 40px;
  padding-bottom: 80px;
}

.page-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.page-header {
  text-align: center;
  margin-bottom: 60px;
}

.page-title {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 16px;
}

.page-subtitle {
  font-size: 1.2rem;
  color: #cccccc;
  font-weight: 500;
}

/* 联系方式网格 */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin-bottom: 80px;
}

.contact-card {
  text-align: center;
  padding: 40px 32px;
}

.contact-icon {
  font-size: 3.5rem;
  margin-bottom: 20px;
  display: block;
}

.contact-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 12px;
}

.contact-desc {
  color: #cccccc;
  line-height: 1.6;
  margin-bottom: 24px;
}

.contact-info {
  margin-bottom: 24px;
}

.info-item {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.info-label {
  color: #999999;
  font-size: 0.95rem;
}

.info-value {
  font-size: 1.1rem;
  font-weight: 600;
  color: #ffffff;
}

.contact-btn {
  width: 100%;
  max-width: 200px;
}

/* 二维码区域 */
.qr-section {
  margin-bottom: 80px;
}

.section-title {
  font-size: 2.5rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 40px;
}

.qr-container {
  display: flex;
  gap: 60px;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: rgba(22, 24, 35, 0.8);
  border-radius: 20px;
  border: 1px solid rgba(254, 44, 85, 0.2);
}

.qr-code-large {
  text-align: center;
}

.qr-image {
  width: 280px;
  height: 280px;
  border-radius: 12px;
  border: 3px solid rgba(254, 44, 85, 0.3);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  background: #ffffff;
  padding: 12px;
}

.qr-desc {
  margin-top: 16px;
  color: #cccccc;
  font-size: 1rem;
}

.qr-benefits {
  flex: 1;
  max-width: 400px;
}

.benefits-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 24px;
}

.benefits-list {
  list-style: none;
  padding: 0;
}

.benefit-item {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  color: #cccccc;
  font-size: 1rem;
}

.benefit-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

/* 购买流程 */
.process-section {
  margin-bottom: 40px;
}

.process-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

.process-step {
  text-align: center;
  padding: 24px;
  background: rgba(22, 24, 35, 0.8);
  border-radius: 16px;
  border: 1px solid rgba(254, 44, 85, 0.2);
  min-width: 200px;
  transition: all 0.3s ease;
}

.process-step:hover {
  transform: translateY(-4px);
  border-color: rgba(254, 44, 85, 0.5);
}

.step-number {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #fe2c55, #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  font-weight: 700;
  color: white;
  margin: 0 auto 16px;
}

.step-content h4 {
  font-size: 1.2rem;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 8px;
}

.step-content p {
  color: #cccccc;
  font-size: 0.9rem;
}

.step-arrow {
  font-size: 2rem;
  color: #fe2c55;
  font-weight: bold;
}

/* 响应式设计 */
@media (max-width: 1024px) {
  .qr-container {
    flex-direction: column;
    gap: 40px;
  }

  .qr-benefits {
    max-width: 100%;
  }
}

@media (max-width: 768px) {
  .page-title {
    font-size: 2.5rem;
  }

  .section-title {
    font-size: 2rem;
  }

  .contact-grid {
    grid-template-columns: 1fr;
  }

  .process-steps {
    flex-direction: column;
  }

  .step-arrow {
    transform: rotate(90deg);
  }

  .qr-image {
    width: 220px;
    height: 220px;
  }
}
</style>

